*Replication files for American Party Women Redux: Stability in Partisan Gender Gaps 
*Authors: Tiffany D. Barnes, Victoria D. Beall, and Erin C. Cassese
*Created March 20, 2020
*Stata 15.1 IC

*******       The following code creates:			   *********
******* Tables 1a and 1b in the manuscript			   *********
******* Tables B1-4 in Appendix B of the Online Appendix *******

*** NOTE: TABLES 1A AND 1B IN THE MANUSCRIPT    ***
*** ARE TRUNCATED VERSIONS OF TABLES B1 AND B2, ***
*** RESPECTIVELY, IN APPENDIX B.				***


set more off
use anes_timeseries_2012_2016_merged_replication.dta, clear 
svyset _n [pweight=V160102], strata(V160201)

************************
***** TABLE 1A/B1 ******
************************
 
*2012 REPUBLICANS
eststo clear

*ABORTION
eststo: svy, subpop(if pid3==3): regress abort4pt_std female religz married eduz income employed homemaker age children black hisp otherrace primary_voter polknow_s south if year == 2012
estimates store est1
eststo: svy, subpop(if pid3==3): regress abort4pt_std female religz married eduz income employed homemaker age children black hisp otherrace primary_voter polknow_s south ideoz govscopez hostile_short egalz if year == 2012
estimates store est2
suest est1 est2
test [est1]female=[est2]female

*CHILDCARE
eststo: svy, subpop(if pid3==3): ologit childz female religz married eduz income employed homemaker age children black hisp otherrace primary_voter polknow_s south if year == 2012
estimates store est3

predict childz2 if e(sample)
corr childz childz2 if e(sample)
di r(rho)^2
//di 1-(1-(r(rho)^2))*(n-1)/(n-v)
di 1-(1-(.1009727))*(5676-1)/(5676-15)
drop childz2

eststo: svy, subpop(if pid3==3): ologit childz female religz married eduz income employed homemaker age children black hisp otherrace primary_voter polknow_s south ideoz govscopez hostile_short egalz if year == 2012
estimates store est4

predict childz2 if e(sample)
corr childz childz2 if e(sample)
di r(rho)^2
//di 1-(1-(r(rho)^2))*(n-1)/(n-v)
di 1-(1-(.25541048))*(5658-1)/(5658-19)
drop childz2

suest est3 est4
test _b[est3_childz:female]=_b[est4_childz:female]

*EDUCATION
eststo: svy, subpop(if pid3==3): ologit school1z female religz married eduz income employed homemaker age children black hisp otherrace primary_voter polknow_s south if year == 2012
estimates store est5

predict school1z2 if e(sample)
corr school1z school1z2 if e(sample)
di r(rho)^2
//di 1-(1-(r(rho)^2))*(n-1)/(n-v)
di 1-(1-(.1045331))*(5682-1)/(5682-15)
drop school1z2

eststo: svy, subpop(if pid3==3): ologit school1z female religz married eduz income employed homemaker age children black hisp otherrace primary_voter polknow_s south ideoz govscopez hostile_short egalz if year == 2012
estimates store est6

predict school1z2 if e(sample)
corr school1z school1z2 if e(sample)
di r(rho)^2
//di 1-(1-(r(rho)^2))*(n-1)/(n-v)
di 1-(1-(.2876559))*(5665-1)/(5665-19)
drop school1z2

suest est5 est6
test _b[est5_school1z:female]=_b[est6_school1z:female]

*HEALTHCARE
eststo: svy, subpop(if pid3==3): regress healthz female religz married eduz income employed homemaker age children black hisp otherrace primary_voter polknow_s south if year == 2012
estimates store est7
eststo: svy, subpop(if pid3==3): regress healthz female religz married eduz income employed homemaker age children black hisp otherrace primary_voter polknow_s south ideoz govscopez hostile_short egalz if year == 2012
estimates store est8
suest est7 est8
test [est7]female=[est8]female

*WELFARE
eststo: svy, subpop(if pid3==3): ologit welfare_2016 female religz married eduz income employed homemaker age children black hisp otherrace primary_voter polknow_s south if year == 2012
estimates store est9

predict welfare2 if e(sample)
corr welfare_2016 welfare2 if e(sample)
di r(rho)^2
//di 1-(1-(r(rho)^2))*(n-1)/(n-v)
di 1-(1-(.10432234))*(5678-1)/(5678-15)
drop welfare2

eststo: svy, subpop(if pid3==3): ologit welfare_2016 female religz married eduz income employed homemaker age children black hisp otherrace primary_voter polknow_s south ideoz govscopez hostile_short egalz if year == 2012
estimates store est10

predict welfare2 if e(sample)
corr welfare_2016 welfare2 if e(sample)
di r(rho)^2
//di 1-(1-(r(rho)^2))*(n-1)/(n-v)
di 1-(1-(.23402462))*(5661-1)/(5661-19)
drop welfare2

suest est9 est10
test _b[est9_welfare_2016:female]=_b[est10_welfare_2016:female]

*GAYRIGHTS
eststo: svy, subpop(if pid3==3): regress gayz female religz married eduz income employed homemaker age children black hisp otherrace primary_voter polknow_s south if year == 2012
estimates store est11
eststo: svy, subpop(if pid3==3): regress gayz female religz married eduz income employed homemaker age children black hisp otherrace primary_voter polknow_s south ideoz govscopez hostile_short egalz if year == 2012
estimates store est12
suest est11 est12
test [est11]female=[est12]female

*DEFENSE
eststo: svy, subpop(if pid3==3): regress defensez female religz married eduz income employed homemaker age children black hisp otherrace primary_voter polknow_s south if year == 2012
estimates store est13
eststo: svy, subpop(if pid3==3): regress defensez female religz married eduz income employed homemaker age children black hisp otherrace primary_voter polknow_s south ideoz govscopez hostile_short egalz if year == 2012
estimates store est14
suest est13 est14
test [est13]female=[est14]female

*MILLIONAIRE TAX
eststo: svy, subpop(if pid3==3): regress millionairetaxz female religz married eduz income employed homemaker age children black hisp otherrace primary_voter polknow_s south if year == 2012
estimates store est15
eststo: svy, subpop(if pid3==3): regress millionairetaxz female religz married eduz income employed homemaker age children black hisp otherrace primary_voter polknow_s south ideoz govscopez hostile_short egalz if year == 2012
estimates store est16
suest est15 est16
test [est15]female=[est16]female

*IMMIGRATION
eststo: svy, subpop(if pid3==3): regress immigration2016 female religz married eduz income employed homemaker age children black hisp otherrace primary_voter polknow_s south if year == 2012
estimates store est17
eststo: svy, subpop(if pid3==3): regress immigration2016 female religz married eduz income employed homemaker age children black hisp otherrace primary_voter polknow_s south ideoz govscopez hostile_short egalz if year == 2012
estimates store est18
suest est17 est18
test [est17]female=[est18]female

*GUNCONTROL
eststo: svy, subpop(if pid3==3): ologit gunz female religz married eduz income employed homemaker age children black hisp otherrace primary_voter polknow_s south if year == 2012
estimates store est19

predict gunz2 if e(sample)
corr gunz gunz2 if e(sample)
di r(rho)^2
//di 1-(1-(r(rho)^2))*(n-1)/(n-v)
di 1-(1-(.05150476))*(5685-1)/(5685-15)
drop gunz2

eststo: svy, subpop(if pid3==3): ologit gunz female religz married eduz income employed homemaker age children black hisp otherrace primary_voter polknow_s south ideoz govscopez hostile_short egalz if year == 2012
estimates store est20

predict gunz2 if e(sample)
corr gunz gunz2 if e(sample)
di r(rho)^2
//di 1-(1-(r(rho)^2))*(n-1)/(n-v)
di 1-(1-(.19482752))*(5667-1)/(5667-19)
drop gunz2

suest est19 est20
test _b[est19_gunz:female]=_b[est20_gunz:female]


# delimit ;
esttab using "table 1_2012_republicanonly.rtf", nogap se b(%9.2f) starlevels(^ .10 * .05 ** .01 *** .001) r2(%9.2f) 
	title("APW Redux 2012 Mediation Models with Hostile Sexism Measure, Republican Respondents" )
	 label
	//addnote("Dependent variable")//
	compress replace;
		#delimit cr
		
		

************************
***** TABLE 1B/B2 ******
************************
	
*2016 REPUBLICANS
eststo clear 

*ABORTION
eststo: svy, subpop(if pid3==3): regress abort4pt_std female religz married eduz income employed homemaker age children black hisp otherrace primary_voter polknow_s south if year == 2016
estimates store est1
eststo: svy, subpop(if pid3==3): regress abort4pt_std female religz married eduz income employed homemaker age children black hisp otherrace primary_voter polknow_s south ideoz govscopez hostile_short egalz if year == 2016
estimates store est2
suest est1 est2
test [est1]female=[est2]female

*CHILDCARE
eststo: svy, subpop(if pid3==3): ologit childz female religz married eduz income employed homemaker age children black hisp otherrace primary_voter polknow_s south if year == 2016
estimates store est3

predict childz2 if e(sample)
corr childz childz2 if e(sample)
di r(rho)^2
//di 1-(1-(r(rho)^2))*(n-1)/(n-v)
di 1-(1-(.03942613))*(4150-1)/(4150-15)
drop childz2

eststo: svy, subpop(if pid3==3): ologit childz female religz married eduz income employed homemaker age children black hisp otherrace primary_voter polknow_s south ideoz govscopez hostile_short egalz if year == 2016
estimates store est4

predict childz2 if e(sample)
corr childz childz2 if e(sample)
di r(rho)^2
//di 1-(1-(r(rho)^2))*(n-1)/(n-v)
di 1-(1-(.21980419))*(3965-1)/(3965-19)
drop childz2

suest est3 est4
test _b[est3_childz:female]=_b[est4_childz:female]


*EDUCATION
eststo: svy, subpop(if pid3==3): ologit school1z female religz married eduz income employed homemaker age children black hisp otherrace primary_voter polknow_s south if year == 2016
estimates store est5

predict school1z2 if e(sample)
corr school1z school1z2 if e(sample)
di r(rho)^2
//di 1-(1-(r(rho)^2))*(n-1)/(n-v)
di 1-(1-(.04140256))*(4157-1)/(4157-15)
drop school1z2

eststo: svy, subpop(if pid3==3): ologit school1z female religz married eduz income employed homemaker age children black hisp otherrace primary_voter polknow_s south ideoz govscopez hostile_short egalz if year == 2016
estimates store est6

predict school1z2 if e(sample)
corr school1z school1z2 if e(sample)
di r(rho)^2
//di 1-(1-(r(rho)^2))*(n-1)/(n-v)
di 1-(1-(.18900354))*(3970-1)/(3970-19)
drop school1z2

suest est5 est6
test _b[est5_school1z:female]=_b[est6_school1z:female]

*HEALTHCARE
eststo: svy, subpop(if pid3==3): regress healthz female religz married eduz income employed homemaker age children black hisp otherrace primary_voter polknow_s south if year == 2016
estimates store est7
eststo: svy, subpop(if pid3==3): regress healthz female religz married eduz income employed homemaker age children black hisp otherrace primary_voter polknow_s south ideoz govscopez hostile_short egalz if year == 2016
estimates store est8
suest est7 est8
test [est7]female=[est8]female

*WELFARE
eststo: svy, subpop(if pid3==3): ologit welfare_2016 female religz married eduz income employed homemaker age children black hisp otherrace primary_voter polknow_s south if year == 2016
estimates store est9

predict welfare2 if e(sample)
corr welfare_2016 welfare2 if e(sample)
di r(rho)^2
//di 1-(1-(r(rho)^2))*(n-1)/(n-v)
di 1-(1-(.05333584))*(4155-1)/(4155-15)
drop welfare2

eststo: svy, subpop(if pid3==3): ologit welfare_2016 female religz married eduz income employed homemaker age children black hisp otherrace primary_voter polknow_s south ideoz govscopez hostile_short egalz if year == 2016
estimates store est10

predict welfare2 if e(sample)
corr welfare_2016 welfare2 if e(sample)
di r(rho)^2
//di 1-(1-(r(rho)^2))*(n-1)/(n-v)
di 1-(1-(.24740636))*(3971-1)/(3971-19)
drop welfare2

suest est9 est10
test _b[est9_welfare_2016:female]=_b[est10_welfare_2016:female]

*GAYRIGHTS
eststo: svy, subpop(if pid3==3): regress gayz female religz married eduz income employed homemaker age children black hisp otherrace primary_voter polknow_s south if year == 2016
estimates store est11
eststo: svy, subpop(if pid3==3): regress gayz female religz married eduz income employed homemaker age children black hisp otherrace primary_voter polknow_s south ideoz govscopez hostile_short egalz if year == 2016
estimates store est12
suest est11 est12
test [est11]female=[est12]female

*DEFENSE
eststo: svy, subpop(if pid3==3): regress defensez female religz married eduz income employed homemaker age children black hisp otherrace primary_voter polknow_s south if year == 2016
estimates store est13
eststo: svy, subpop(if pid3==3): regress defensez female religz married eduz income employed homemaker age children black hisp otherrace primary_voter polknow_s south ideoz govscopez hostile_short egalz if year == 2016
estimates store est14
suest est13 est14
test [est13]female=[est14]female

*MILLIONAIRE TAX
eststo: svy, subpop(if pid3==3): regress millionairetaxz female religz married eduz income employed homemaker age children black hisp otherrace primary_voter polknow_s south if year == 2016
estimates store est15
eststo: svy, subpop(if pid3==3): regress millionairetaxz female religz married eduz income employed homemaker age children black hisp otherrace primary_voter polknow_s south ideoz govscopez hostile_short egalz if year == 2016
estimates store est16
suest est15 est16
test [est15]female=[est16]female

*IMMIGRATION
eststo: svy, subpop(if pid3==3): regress immigration2016 female religz married eduz income employed homemaker age children black hisp otherrace primary_voter polknow_s south if year == 2016
estimates store est17
eststo: svy, subpop(if pid3==3): regress immigration2016 female religz married eduz income employed homemaker age children black hisp otherrace primary_voter polknow_s south ideoz govscopez hostile_short egalz if year == 2016
estimates store est18
suest est17 est18
test [est17]female=[est18]female

*GUNCONTROL
eststo: svy, subpop(if pid3==3): ologit gunz female religz married eduz income employed homemaker age children black hisp otherrace primary_voter polknow_s south if year == 2016
estimates store est19

predict gunz2 if e(sample)
corr gunz gunz2 if e(sample)
di r(rho)^2
//di 1-(1-(r(rho)^2))*(n-1)/(n-v)
di 1-(1-(.0460471))*(4155-1)/(4155-15)
drop gunz2

eststo: svy, subpop(if pid3==3): ologit gunz female religz married eduz income employed homemaker age children black hisp otherrace primary_voter polknow_s south ideoz govscopez hostile_short egalz if year == 2016
estimates store est20

predict gunz2 if e(sample)
corr gunz gunz2 if e(sample)
di r(rho)^2
//di 1-(1-(r(rho)^2))*(n-1)/(n-v)
di 1-(1-(.28264564))*(3970-1)/(3970-19)
drop gunz2

suest est19 est20
test _b[est19_gunz:female]=_b[est20_gunz:female]


# delimit ;
esttab using "table 1_2016_republicanonly_fix.rtf", nogap se b(%9.2f) starlevels(^ .10 * .05 ** .01 *** .001) r2(%9.2f) 
	title("APW Redux 2016 Mediation Models with Hostile Sexism Measure, Republican Respondents" )
	 label
	//addnote("Dependent variable")//
	compress replace;
		#delimit cr

************************
****** TABLE B3 ********
************************	

*2012 SUREGS DEMOCRATS
eststo clear

*ABORTION
eststo: svy, subpop(if pid3==1): regress abort4pt_std female religz married eduz income employed homemaker age children black hisp otherrace primary_voter polknow_s south if year == 2012
estimates store est1
eststo: svy, subpop(if pid3==1): regress abort4pt_std female religz married eduz income employed homemaker age children black hisp otherrace primary_voter polknow_s south ideoz govscopez hostile_short egalz if year == 2012
estimates store est2
suest est1 est2
test [est1]female=[est2]female

*CHILDCARE
eststo: svy, subpop(if pid3==1): ologit childz female religz married eduz income employed homemaker age children black hisp otherrace primary_voter polknow_s south if year == 2012
estimates store est3

predict childz2 if e(sample)
corr childz childz2 if e(sample)
di r(rho)^2
//di 1-(1-(r(rho)^2))*(n-1)/(n-v)
di 1-(1-(.05524727))*(5525-1)/(5525-15)
drop childz2

eststo: svy, subpop(if pid3==1): ologit childz female religz married eduz income employed homemaker age children black hisp otherrace primary_voter polknow_s south ideoz govscopez hostile_short egalz if year == 2012
estimates store est4

predict childz2 if e(sample)
corr childz childz2 if e(sample)
di r(rho)^2
//di 1-(1-(r(rho)^2))*(n-1)/(n-v)
di 1-(1-(.25505365))*(5451-1)/(5451-19)
drop childz2

suest est3 est4
test _b[est3_childz:female]=_b[est4_childz:female]


*EDUCATION
eststo: svy, subpop(if pid3==1): ologit school1z female religz married eduz income employed homemaker age children black hisp otherrace primary_voter polknow_s south if year == 2012
estimates store est5

predict school1z2 if e(sample)
corr school1z school1z2 if e(sample)
di r(rho)^2
//di 1-(1-(r(rho)^2))*(n-1)/(n-v)
di 1-(1-(.01882233))*(5537-1)/(5537-15)
drop school1z2

eststo: svy, subpop(if pid3==1): ologit school1z female religz married eduz income employed homemaker age children black hisp otherrace primary_voter polknow_s south ideoz govscopez hostile_short egalz if year == 2012
estimates store est6

predict school1z2 if e(sample)
corr school1z school1z2 if e(sample)
di r(rho)^2
//di 1-(1-(r(rho)^2))*(n-1)/(n-v)
di 1-(1-(.2650688))*(5463-1)/(5463-19)
drop school1z2

suest est5 est6
test _b[est5_school1z:female]=_b[est6_school1z:female]

*HEALTHCARE
eststo: svy, subpop(if pid3==1): regress healthz female religz married eduz income employed homemaker age children black hisp otherrace primary_voter polknow_s south if year == 2012
estimates store est7
eststo: svy, subpop(if pid3==1): regress healthz female religz married eduz income employed homemaker age children black hisp otherrace primary_voter polknow_s south ideoz govscopez hostile_short egalz if year == 2012
estimates store est8
suest est7 est8
test [est7]female=[est8]female

*WELFARE
eststo: svy, subpop(if pid3==1): ologit welfare_2016 female religz married eduz income employed homemaker age children black hisp otherrace primary_voter polknow_s south if year == 2012
estimates store est9

predict welfare2 if e(sample)
corr welfare_2016 welfare2 if e(sample)
di r(rho)^2
//di 1-(1-(r(rho)^2))*(n-1)/(n-v)
di 1-(1-(.06982306))*(5527-1)/(5527-15)
drop welfare2

eststo: svy, subpop(if pid3==1): ologit welfare_2016 female religz married eduz income employed homemaker age children black hisp otherrace primary_voter polknow_s south ideoz govscopez hostile_short egalz if year == 2012
estimates store est10

predict welfare2 if e(sample)
corr welfare_2016 welfare2 if e(sample)
di r(rho)^2
//di 1-(1-(r(rho)^2))*(n-1)/(n-v)
di 1-(1-(.2449214))*(5446-1)/(5456-19)
drop welfare2

suest est9 est10
test _b[est9_welfare_2016:female]=_b[est10_welfare_2016:female]

*GAYRIGHTS
eststo: svy, subpop(if pid3==1): regress gayz female religz married eduz income employed homemaker age children black hisp otherrace primary_voter polknow_s south if year == 2012
estimates store est11
eststo: svy, subpop(if pid3==1): regress gayz female religz married eduz income employed homemaker age children black hisp otherrace primary_voter polknow_s south ideoz govscopez hostile_short egalz if year == 2012
estimates store est12
suest est11 est12
test [est11]female=[est12]female

*DEFENSE
eststo: svy, subpop(if pid3==1): regress defensez female religz married eduz income employed homemaker age children black hisp otherrace primary_voter polknow_s south if year == 2012
estimates store est13
eststo: svy, subpop(if pid3==1): regress defensez female religz married eduz income employed homemaker age children black hisp otherrace primary_voter polknow_s south ideoz govscopez hostile_short egalz if year == 2012
estimates store est14
suest est13 est14
test [est13]female=[est14]female

*MILLIONAIRE TAX
eststo: svy, subpop(if pid3==1): regress millionairetaxz female religz married eduz income employed homemaker age children black hisp otherrace primary_voter polknow_s south if year == 2012
estimates store est15
eststo: svy, subpop(if pid3==1): regress millionairetaxz female religz married eduz income employed homemaker age children black hisp otherrace primary_voter polknow_s south ideoz govscopez hostile_short egalz if year == 2012
estimates store est16
suest est15 est16
test [est15]female=[est16]female

*IMMIGRATION
eststo: svy, subpop(if pid3==1): regress immigration2016 female religz married eduz income employed homemaker age children black hisp otherrace primary_voter polknow_s south if year == 2012
estimates store est17
eststo: svy, subpop(if pid3==1): regress immigration2016 female religz married eduz income employed homemaker age children black hisp otherrace primary_voter polknow_s south ideoz govscopez hostile_short egalz if year == 2012
estimates store est18
suest est17 est18
test [est17]female=[est18]female

*GUNCONTROL
eststo: svy, subpop(if pid3==1): ologit gunz female religz married eduz income employed homemaker age children black hisp otherrace primary_voter polknow_s south if year == 2012
estimates store est19

predict gunz2 if e(sample)
corr gunz gunz2 if e(sample)
di r(rho)^2
//di 1-(1-(r(rho)^2))*(n-1)/(n-v)
di 1-(1-(.04145587))*(5537-1)/(5537-15)
drop gunz2

eststo: svy, subpop(if pid3==1): ologit gunz female religz married eduz income employed homemaker age children black hisp otherrace primary_voter polknow_s south ideoz govscopez hostile_short egalz if year == 2012
estimates store est20

predict gunz2 if e(sample)
corr gunz gunz2 if e(sample)
di r(rho)^2
//di 1-(1-(r(rho)^2))*(n-1)/(n-v)
di 1-(1-(.18085297))*(5461-1)/(5461-19)
drop gunz2

suest est19 est20
test _b[est19_gunz:female]=_b[est20_gunz:female]

# delimit ;
esttab using "table 2_2012_democratonly.rtf", nogap se b(%9.2f) starlevels(^ .10 * .05 ** .01 *** .001) r2(%9.2f) 
	title("APW Redux 2012 Mediation Models with Hostile Sexism Measure, Democrat Respondents" )
	 label
	//addnote("Dependent variable")//
	compress replace; 
	#delimit cr

************************
****** TABLE B4 ********
************************

*2016 DEMOCRATS
eststo clear

*ABORTION
eststo: svy, subpop(if pid3==1): regress abort4pt_std female religz married eduz income employed homemaker age children black hisp otherrace primary_voter polknow_s south if year == 2016
estimates store est1
eststo: svy, subpop(if pid3==1): regress abort4pt_std female religz married eduz income employed homemaker age children black hisp otherrace primary_voter polknow_s south ideoz govscopez hostile_short egalz if year == 2016
estimates store est2
suest est1 est2
test [est1]female=[est2]female

*CHILDCARE
eststo: svy, subpop(if pid3==1): ologit childz female religz married eduz income employed homemaker age children black hisp otherrace primary_voter polknow_s south if year == 2016
estimates store est3

predict childz2 if e(sample)
corr childz childz2 if e(sample)
di r(rho)^2
//di 1-(1-(r(rho)^2))*(n-1)/(n-v)
di 1-(1-(.00365807))*(4150-1)/(4150-15)
drop childz2

eststo: svy, subpop(if pid3==1): ologit childz female religz married eduz income employed homemaker age children black hisp otherrace primary_voter polknow_s south ideoz govscopez hostile_short egalz if year == 2016
estimates store est4

predict childz2 if e(sample)
corr childz childz2 if e(sample)
di r(rho)^2
//di 1-(1-(r(rho)^2))*(n-1)/(n-v)
di 1-(1-(.19892315))*(3799-1)/(3799-19)
drop childz2

suest est3 est4
test _b[est3_childz:female]=_b[est4_childz:female]


*EDUCATION
eststo: svy, subpop(if pid3==1): ologit school1z female religz married eduz income employed homemaker age children black hisp otherrace primary_voter polknow_s south if year == 2016
estimates store est5

predict school1z2 if e(sample)
corr school1z school1z2 if e(sample)
di r(rho)^2
//di 1-(1-(r(rho)^2))*(n-1)/(n-v)
di 1-(1-(.00538072))*(4157-1)/(4157-15)
drop school1z2

eststo: svy, subpop(if pid3==1): ologit school1z female religz married eduz income employed homemaker age children black hisp otherrace primary_voter polknow_s south ideoz govscopez hostile_short egalz if year == 2016
estimates store est6

predict school1z2 if e(sample)
corr school1z school1z2 if e(sample)
di r(rho)^2
//di 1-(1-(r(rho)^2))*(n-1)/(n-v)
di 1-(1-(.18801762))*(3805-1)/(3805-19)
drop school1z2

suest est5 est6
test _b[est5_school1z:female]=_b[est6_school1z:female]

*HEALTHCARE
eststo: svy, subpop(if pid3==1): regress healthz female religz married eduz income employed homemaker age children black hisp otherrace primary_voter polknow_s south if year == 2016
estimates store est7
eststo: svy, subpop(if pid3==1): regress healthz female religz married eduz income employed homemaker age children black hisp otherrace primary_voter polknow_s south ideoz govscopez hostile_short egalz if year == 2016
estimates store est8
suest est7 est8
test [est7]female=[est8]female

*WELFARE
eststo: svy, subpop(if pid3==1): ologit welfare_2016 female religz married eduz income employed homemaker age children black hisp otherrace primary_voter polknow_s south if year == 2016
estimates store est9

predict welfare2 if e(sample)
corr welfare_2016 welfare2 if e(sample)
di r(rho)^2
//di 1-(1-(r(rho)^2))*(n-1)/(n-v)
di 1-(1-(.02825941))*(4153-1)/(4153-15)
drop welfare2

eststo: svy, subpop(if pid3==1): ologit welfare_2016 female religz married eduz income employed homemaker age children black hisp otherrace primary_voter polknow_s south ideoz govscopez hostile_short egalz if year == 2016
estimates store est10

predict welfare2 if e(sample)
corr welfare_2016 welfare2 if e(sample)
di r(rho)^2
//di 1-(1-(r(rho)^2))*(n-1)/(n-v)
di 1-(1-(.34115406))*(3800-1)/(3800-19)
drop welfare2

suest est9 est10
test _b[est9_welfare_2016:female]=_b[est10_welfare_2016:female]

*GAYRIGHTS
eststo: svy, subpop(if pid3==1): regress gayz female religz married eduz income employed homemaker age children black hisp otherrace primary_voter polknow_s south if year == 2016
estimates store est11
eststo: svy, subpop(if pid3==1): regress gayz female religz married eduz income employed homemaker age children black hisp otherrace primary_voter polknow_s south ideoz govscopez hostile_short egalz if year == 2016
estimates store est12
suest est11 est12
test [est11]female=[est12]female

*DEFENSE
eststo: svy, subpop(if pid3==1): regress defensez female religz married eduz income employed homemaker age children black hisp otherrace primary_voter polknow_s south if year == 2016
estimates store est13
eststo: svy, subpop(if pid3==1): regress defensez female religz married eduz income employed homemaker age children black hisp otherrace primary_voter polknow_s south ideoz govscopez hostile_short egalz if year == 2016
estimates store est14
suest est13 est14
test [est13]female=[est14]female

*MILLIONAIRE TAX
eststo: svy, subpop(if pid3==1): regress millionairetaxz female religz married eduz income employed homemaker age children black hisp otherrace primary_voter polknow_s south if year == 2016
estimates store est15
eststo: svy, subpop(if pid3==1): regress millionairetaxz female religz married eduz income employed homemaker age children black hisp otherrace primary_voter polknow_s south ideoz govscopez hostile_short egalz if year == 2016
estimates store est16
suest est15 est16
test [est15]female=[est16]female

*IMMIGRATION
eststo: svy, subpop(if pid3==1): regress immigration2016 female religz married eduz income employed homemaker age children black hisp otherrace primary_voter polknow_s south if year == 2016
estimates store est17
eststo: svy, subpop(if pid3==1): regress immigration2016 female religz married eduz income employed homemaker age children black hisp otherrace primary_voter polknow_s south ideoz govscopez hostile_short egalz if year == 2016
estimates store est18
suest est17 est18
test [est17]female=[est18]female

*GUNCONTROL
eststo: svy, subpop(if pid3==1): ologit gunz female religz married eduz income employed homemaker age children black hisp otherrace primary_voter polknow_s south if year == 2016
estimates store est19

predict gunz2 if e(sample)
corr gunz gunz2 if e(sample)
di r(rho)^2
//di 1-(1-(r(rho)^2))*(n-1)/(n-v)
di 1-(1-(.04538435))*(4156-1)/(4156-15)
drop gunz2

eststo: svy, subpop(if pid3==1): ologit gunz female religz married eduz income employed homemaker age children black hisp otherrace primary_voter polknow_s south ideoz govscopez hostile_short egalz if year == 2016
estimates store est20

predict gunz2 if e(sample)
corr gunz gunz2 if e(sample)
di r(rho)^2
//di 1-(1-(r(rho)^2))*(n-1)/(n-v)
di 1-(1-(.26912797))*(3801-1)/(3801-19)
drop gunz2

suest est19 est20
test _b[est19_gunz:female]=_b[est20_gunz:female]

# delimit ;
esttab using "table 2_2016_democratonly.rtf", nogap se b(%9.2f) starlevels(^ .10 * .05 ** .01 *** .001) r2(%9.2f) 
	title("APW Redux 2016 Mediation Models with Hostile Sexism Measure, Democrat Respondents" )
	 label
	//addnote("Dependent variable")//
	compress replace;
		#delimit cr
